# 虚拟内存
fallocate -l 8G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

# 替换镜像
yum install -y wget
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
yum makecache

# 系统更新
yum -y update
yum install -y yum-utils device-mapper-persistent-data lvm2

# 加入docker-ce
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum install -y docker-ce

# docker 更换镜像
mkdir -p /etc/docker
touch  /etc/docker/daemon.json

daemon="
{  \"registry-mirrors\" : [
    \"https://mirror.ccs.tencentyun.com\",
	 \"https://registry.docker-cn.com\",
	 \"https://docker.mirrors.ustc.edu.cn\",
	 \"http://hub-mirror.c.163.com\"
 ]}"

echo $daemon >/etc/docker/daemon.json
unset daemon
systemctl start docker

systemctl enable docker

docker pull java:alpine

#创建mysql目录用来存储数据、配置和日志
mkdir -p ~/mysql/conf
mkdir -p ~/mysql/logs
mkdir -p ~/mysql/data
#安装
docker pull mysql:5.7

docker pull redis:5.0.2

mkdir -p ~/nacos/logs
docker pull docker.io/nacos/nacos-server:2.0.3

mkdir -p ~/rabbitmq/plugins
docker pull rabbitmq:3.8-management

mkdir -p ~/nginx/nginx.conf
mkdir -p ~/nginx/conf/conf.d
mkdir -p ~/nginx/html
mkdir -p ~/nginx/logs

mkdir -p ~/data

#docker pull nginx:latest

#docker pull  openzipkin/zipkin
#docker pull minio/minio
#
#mkdir -p ~/elastic/data
#
#docker pull docker.elastic.co/elasticsearch/elasticsearch:7.7.0